-
Notifications
You must be signed in to change notification settings - Fork 3.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Metrics] Detach bugfix #4313
[Metrics] Detach bugfix #4313
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good catch nice work :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just a few typos in the added documentation.
Co-authored-by: Teddy Koker <teddy.koker@gmail.com>
…i/pytorch-lightning into metrics/detach_bugfix
Codecov Report
@@ Coverage Diff @@
## master #4313 +/- ##
======================================
Coverage 93% 93%
======================================
Files 113 113
Lines 8222 8198 -24
======================================
- Hits 7637 7622 -15
+ Misses 585 576 -9 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is a huge catch, thank you @SkafteNicki ...I was goin OOM on GPU when training on large dataset last night, and this is definitely the culprit.
This pull request is now in conflict... :( |
Co-authored-by: Adrian Wälchli <aedu.waelchli@gmail.com>
Looks good! I was contemplating if the |
* detach on buffer * doc update * remove file * changelog * suggestions * Update docs/source/metrics.rst Co-authored-by: Teddy Koker <teddy.koker@gmail.com> * fix for 4266 * Update docs/source/metrics.rst Co-authored-by: Adrian Wälchli <aedu.waelchli@gmail.com> * Update CHANGELOG.md Co-authored-by: Teddy Koker <teddy.koker@gmail.com> Co-authored-by: chaton <thomas@grid.ai> Co-authored-by: Adrian Wälchli <aedu.waelchli@gmail.com> Co-authored-by: Ananya Harsh Jha <ananya@pytorchlightning.ai> Co-authored-by: Roger Shieh <sh.rog@protonmail.ch> Co-authored-by: Sean Naren <sean.narenthiran@gmail.com> Co-authored-by: Rohit Gupta <rohitgr1998@gmail.com> (cherry picked from commit 19187d3)
* detach on buffer * doc update * remove file * changelog * suggestions * Update docs/source/metrics.rst Co-authored-by: Teddy Koker <teddy.koker@gmail.com> * fix for 4266 * Update docs/source/metrics.rst Co-authored-by: Adrian Wälchli <aedu.waelchli@gmail.com> * Update CHANGELOG.md Co-authored-by: Teddy Koker <teddy.koker@gmail.com> Co-authored-by: chaton <thomas@grid.ai> Co-authored-by: Adrian Wälchli <aedu.waelchli@gmail.com> Co-authored-by: Ananya Harsh Jha <ananya@pytorchlightning.ai> Co-authored-by: Roger Shieh <sh.rog@protonmail.ch> Co-authored-by: Sean Naren <sean.narenthiran@gmail.com> Co-authored-by: Rohit Gupta <rohitgr1998@gmail.com>
What does this PR do?
Fixes #4098
Fixes #4266
Make sure that the metrics states gets detached from the computational graph to prevent memory consumption from growing.
Also make sure that results gets detached for logging.
Also added note on how metrics can be backproped.
Before submitting
PR review
Anyone in the community is free to review the PR once the tests have passed.
If we didn't discuss your PR in Github issues there's a high chance it will not be merged.
Did you have fun?
Make sure you had fun coding 🙃